//---------------------------------------------------------------------
// Author: jachymko
//
// Description: StaticExpression tab expansion handler tests
//
// Creation Date: Jan 1, 2007
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Management.Automation;
using System.Management.Automation.Runspaces;
using System.Text;
using NUnit.Framework;
using Pscx.Commands;

namespace PscxUnitTests.TabExpansion
{
    [TestFixture]
    public class StaticExpressionTest : TabExpansionTestBase
    {
        [Test]
        public void ExpandStaticMethod()
        {
            AssertExpansions("[String]::IsNullOrEm", new string[] 
            {
                "[String]::IsNullOrEmpty("
            });
        }

        [Test]
        public void ExpandStaticProperty()
        {
            AssertExpansions("[System.Console]::WindowHei", new string[] 
            {
                "[System.Console]::WindowHeight"
            });
        }

        [Test]
        public void ExpandStaticPropertyMethod()
        {
            AssertExpansions("[Text.Encoding]::Unicode.get_EncodingN", new string[] 
            {
                "[Text.Encoding]::Unicode.get_EncodingName()"
            });
        }

        [Test]
        public void ExpandStaticMultiProperty()
        {
            AssertExpansions("[console]::OutputEncoding.encodingna", new string[] 
            {
                "[console]::OutputEncoding.EncodingName"
            });
        }

        [Test]
        public void ExpandGetTypeMembers()
        {
            AssertExpansions("[System.Console].get_IsC", new string[]
            {
                "[System.Console].get_IsClass()",
                "[System.Console].get_IsCOMObject()",
                "[System.Console].get_IsContextful()"
            });
        }

        [Test]
        public void ExpandAllMembers()
        {
            AssertExpansions("[ObjeCT]::", new string[]
            {
                "[ObjeCT]::Equals(",
                "[ObjeCT]::ReferenceEquals("
            });
        }
    }
}
